﻿@model ATTools.ViewModels.VoiceCommandsAdminEditViewModel
@using ATTools.Models;
@{
    var title = T("Editing Voice Command");
    var id = T("ID:");

    Layout.Title = title.ToString() + " - " + id.ToString() +" " + Model.Id;
    
}
@using (Html.BeginFormAntiForgeryPost()) { 
    <fieldset>
        @Html.LabelFor(m => m.Description, T("What should users say to activate this command? - Example: \"Search for\""))
        @Html.TextBoxFor(m => m.Description, new { @class = "text", placeholder = T("Enter a string") })
    </fieldset>
    <fieldset>
        @Html.LabelFor(m => m.CommandType, T("Type of execution"))
        <select id="CommandType" name="@Html.NameOf(m => m.CommandType)">
            @Html.SelectOption(Model.CommandType, CommandType.GoToUrl, T("Go to an url").ToString())
            @Html.SelectOption(Model.CommandType, CommandType.JavaScript, T("Execute JavaScript").ToString())
        </select>
    </fieldset>
    <fieldset>
        @Html.LabelFor(m => m.CommandData, T("What do you want to execute on activation. Note: The text users say after the defined command string you get by {value} - Example: \"/Search?q={value}\""))
        @Html.TextAreaFor(m => m.CommandData, new { @class = "text", placeholder = T("Enter what you want to execute") })
    </fieldset>
    <fieldset>
        <button class="primaryAction" type="submit" name="submit.Create" value="yes">@T("Save Voice Command")</button>
    </fieldset>
}